home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
devel
/
vbcc-68k-src
/
machines
/
amiga68k
/
libsrc
/
extra
/
strnicmp.c
< prev
Wrap
C/C++ Source or Header
|
1999-01-01
|
530b
|
23 lines
#include <ctype.h>
#include <string.h>
/*
** strnicmp() - Compare n nr of chars in two strings incasesensitivly.
**
** Made by Kasper B. Graversen (c) 1996
**
** fixed by phx 01/98
**
** This is freeware - use at own risc.
*/
int strnicmp(const char *str1, const char *str2, size_t n)
{
if(n==0) return 0;
while(--n && tolower((unsigned char)*str1)==tolower((unsigned char)*str2)){
if(!*str1) return(0);
str1++;str2++;
}
return(tolower(*(unsigned char *)str1)-tolower(*(unsigned char *)str2));
}